package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.infrastructure.entity.IeoRule;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import com.novax.ex.activity.infrastructure.mapper.IeoRuleMapper;

import java.util.List;

/**
 * @Description ieo活动规则service
 * @Author Cody
 * @Date 2022/12/05/10:39
 */

@Service
public class IeoRuleService extends BaseService {

    @Resource
    private IeoRuleMapper ieoRuleMapper;


    @Override
    protected BaseMapper getBaseMapper() {
        return ieoRuleMapper;
    }

    /**
     * 黄涛
     * 发现通过ieo id
     *
     * @param ieoId ieo id
     * @return {@link IeoRule}
     */
    public List<IeoRule> findByIeoId(Long ieoId) {
        return ieoRuleMapper.selectByIeoId(ieoId);
    }

    public IeoRule findRuleByIeoIdAndLanguage(Long ieoId, String language) {
        return ieoRuleMapper.selectByIeoIdAndLanguage(ieoId, language);
    }
}
